import React from 'react'
import cx from 'classnames'
import style from './style'

class Button extends React.Component {

	static defaultProps = {
		blue: true
	}

	render() {
		const { cancel, green, blueLine, white, blue, upload, label, className, ...others } = this.props
		return (
			<button
				data-role="button"
				{...others}
				className={cx({
					[className]: !!className,
					[style.root]: true,
					[style.blue]: blue && !cancel && !white && !blueLine && !green && !upload,
					[style.white]: white && !others.disabled,
					[style.blueLine]: blueLine && !others.disabled,
					[style.green]: green && !others.disabled,
          [style.cancel]: cancel && !others.disabled,
          [style.upload]: upload && !others.disabled
				})}
			>
				<span>{label}</span>
			</button>
		)
	}
}

export default Button
